package no.sachmuld.methodcombination.impl;

import no.sachmuld.methodcombination.api.Condition;
import no.sachmuld.methodcombination.impl.MultiCondition;

import java.util.List;

/**
 *
 */
public class MultiPrecondition extends MultiCondition {

    private List<Condition> conditions;

    public MultiPrecondition(List<Condition> conditions) {
        super(conditions, '|');
        this.conditions = conditions;
    }

    @Override
    public boolean getValue() {
        for (Condition condition : conditions) {
            if (condition.getValue()) {
                return true;
            }
        }
        return false;
    }


}
